package com.mall.web.util;

import javax.servlet.http.HttpServletRequest;

/**
 * 请求的类型。eshop还是城市助手
 * 
 * @author Administrator
 *
 */
public class HttpUrlTypeUtil {

	/**
	 * 是否是ESHOP
	 * 
	 * @param request
	 * @return
	 */
	public static boolean isEshopUrl(HttpServletRequest request) {
		String uri = request.getRequestURI();
		if (uri.indexOf("/eshop/") > -1) {
			return true;
		}
		return false;
	}

	public static int isHttpUrl(HttpServletRequest request) {
		String uri = request.getRequestURI();
		if (uri.indexOf("/eshop/") > -1) {
			return 2;
		} else if (uri.indexOf("/weishang/") > -1) {
			return 5;
		}
		return 0;
	}

	public static int isPsIstallUrl(HttpServletRequest request) {
		String uri = request.getRequestURI();
		if (uri.indexOf("/ps/task/") > -1) {
			return 1;
		}
		return 0;
	}

	/**
	 * 是否是ESHOP
	 * 
	 * @param request
	 * @return
	 */
	public static boolean isWeiShang(HttpServletRequest request) {
		String uri = request.getRequestURI();
		if (uri.indexOf("/weishang/") > -1) {
			return true;
		}
		return false;
	}
	/**
	 * 是否是ps
	 * 
	 * @param request
	 * @return
	 */
	public static boolean isPs(HttpServletRequest request) {
		String uri = request.getRequestURI();
		if (uri.indexOf("/ps/") > -1) {
			return true;
		}
		return false;
	}
	
	/**
	 * 是否是买个店微商系统
	 * 
	 * @param request
	 * @return
	 */
	public static boolean isMaidian(HttpServletRequest request) {
		String uri = request.getRequestURI();
		if (uri.indexOf("/maidian/") > -1) {
			return true;
		}
		return false;
	}
}
